localhost 您所在的位置:网站首页 linux ssh localhost localhost

localhost

2023-11-15 18:00| 来源: 网络整理| 查看: 265

First Method:

Launch an SSH tunnel

To initiate your SSH tunnel, simply open terminal and connect to your remote server via SSH with the following flags:

ssh -D 8080 -C -N [email protected]

Browse the Web with Your SSH Tunnel (Chrome)

Now, let’s start browsing the web using our new SSH tunnel.

Open Google Chrome Select the wrench icon on the top right Select ‘Settings’ Select ‘Show advanced settings…’ Select ‘Change proxy settings…’ Select ‘SOCKS Proxy’ Enter ’127.0.0.1′ Enter port ’8080′ Save changes by selecting ‘OK’

Search Google for ‘my ip’ and take a look at what your IP address is now.

This will launch our SSH tunnel on port 8080 and route all traffic (securely) through the server at example.com.

Exiting the SSH Tunnel

To exit the SSH tunnel, simply disable the SOCKS proxy within your browser.

source

Second Method:

You can do it easily using Shellinabox

Ensure that you have checked Universe Repository

To install

$ sudo apt-get install openssl shellinabox

Configuring Shellinabox

By default, shellinaboxd listens on TCP port 4200 on localhost.During installation a new self-signed SSL certificate automatically created under “/var/lib/shellinabox” to use HTTPS protocol.

$ sudo vi /etc/default/shellinabox # specify the IP address of a destination SSH server SHELLINABOX_ARGS="--o-beep -s /:SSH:172.16.25.125" # if you want to restrict access to shellinaboxd from localhost only SHELLINABOX_ARGS="--o-beep -s /:SSH:172.16.25.125 --localhost-only"

NB: replace the ip 172.16.25.125 with yours

Starting Shellinabox

Once you’ve done with the configuration, you can start the service

$ sudo service shellinaboxd start

Verify Shellinabox

Now let’s verify whether Shellinabox is running on port 4200 using “netstat” command.

$ sudo netstat -nap | grep shellinabox or # netstat -nap | grep shellinabox tcp 0 0 0.0.0.0:4200 0.0.0.0:* LISTEN 12274/shellinaboxd

Now open up your web browser, and navigate to 'https://"Your-IP-Adress:6175"'. You should be able to see a web-based SSH terminal. Login using your username and password and you should be presented with your shell prompt.

enter image description here

source



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有